package com.itheima.day16_多态接口.deno06;

public class Keeper {
    public void keeper(Animal a){
        a.Water();
        a.eat();
        if(a instanceof Dog){
            Dog dog = (Dog)a;
            dog.swim();
        }else if(a instanceof Frog){
            Frog frog = (Frog)a;
            ((Frog) a).swim();
        }
    }
}
